<template>
	<view v-if="show">
		<view class="title">
			<view class="h1">
				{{ detail.title }}
			</view>
			<view class="time">
				{{ detail.createtime_text }}
			</view>
		</view>

		<view class="content">
			<u-parse :content="detail.content" :imageProp="{mode:'widthFix'}"></u-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				show: false,
				detail: {}
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getDetail()
		},
		methods: {
			getDetail() {
				let _this = this
				uni.showLoading({
					title: '加载中...'
				})
				_this.$api.get('meet/article.article/detail', {
					id: this.id
				}).then(res => {
					uni.hideLoading()
					if (res.code == 1) {
						_this.detail = res.data
						_this.show = true
					} else {
						uni.showModal({
							title: '提示',
							content: res.msg,
							showCancel: false,
							cancelText: '取消',
							confirmText: '确认',
							success: res => {},
							fail: () => {},
							complete: () => {
								uni.navigateBack({
									delta: 1
								})
							}
						});
					}
				}, fail => {})
			}
		}
	}
</script>

<style lang="scss">
	.title {
		position: relative;
		padding: 15px;
		background: #fff;
		border-bottom: 1px solid #eee;
	}

	.title .h1 {
		font-size: 22px;
		line-height: 25px;
	}

	.title .time {
		margin-top: 5px;
		font-size: 12px;
		color: #bbb;
	}

	.content {
		padding: 15px;
		background: #fff;
		padding-bottom: 20px;

		image {
			width: 706rpx !important;
			display: block;
			margin: 0 auto;
			margin-left: 0rpx;
		}
	}
</style>